package com.open.capacity.paper.service;

import com.open.capacity.paper.vo.PaperRecordInfoVo;
import com.open.capacity.paper.vo.PaperVo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.open.capacity.common.exception.service.ServiceException;
import com.open.capacity.common.model.Paper;
import com.open.capacity.common.web.PageResult;
import com.open.capacity.common.web.Result;

import java.util.Map;

public interface PaperService extends IService<Paper> {
    /**
     * 分页查询
     *
     * @param params Map<String, Object>
     * @return PageResult
     */
    PageResult<PaperVo> getPapers(Map<String, Object> params) throws ServiceException;

    /**
     * 更新
     *
     * @param paper Paper
     * @return Result
     */
    Result updatePaper(Paper paper) throws ServiceException;

    /**
     * 插入
     *
     * @param paper Paper
     * @return Result
     */
    Result savePaper(Paper paper) throws ServiceException;

    /**
     * 根据id查询
     *
     * @param id 问卷id
     * @return Result
     */
    Result findById(Integer id) throws ServiceException;

    /**
     * 逻辑删除
     *
     * @param id 问卷Id
     * @return Result
     */
    Result deletePaper(Integer id) throws ServiceException;

    /**
     * 根据问卷id查问题以及选项
     *
     * @param paperId 问卷Id
     * @return Result
     */
    Result getQuestionAndOption(Integer paperId) throws ServiceException;

    /**
     * 保存问卷数据
     *
     * @param paperRecordInfoVo 问卷信息
     * @return Result
     */
    Result savePaperData(PaperRecordInfoVo paperRecordInfoVo) throws ServiceException;

    /**
     * 修改问卷数据
     *
     * @param paperRecordInfoVo PaperRecordInfoVo
     * @return Result
     */
    Result updatePaperData(PaperRecordInfoVo paperRecordInfoVo) throws ServiceException;

    /**
     * 根据用户Id以及问卷Id查问卷记录
     *
     * @param params Map<String, Object>
     * @return Result
     */
    Result findPaperRecord(Map<String, Object> params) throws ServiceException;

    /**
     * 根据用户Id以及问卷Id查问卷记录详情
     *
     * @return Result
     */
    Result findPaperInfo(Integer id, Long userId) throws ServiceException;

    /**
     * 获取评分统计数据(饼状图)
     *
     * @param id 问卷id
     * @return Result
     */
    Result getPaperPieData(Integer id) throws ServiceException;

    /**
     * 获取评分统计数据(条形图)
     *
     * @param id 问卷id
     * @return Result
     */
    Result getPaperLinearData(Integer id) throws ServiceException;
}
